

<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'service-grid',
 'dataProvider' => $model->search(),
 'filter' => $model,
 'itemsCssClass' => 'table table-hover',
'columns' => array(
array(
'name' => 'img1',
 'type' => 'image',
 'value' => '"/uploads/$data->img1"',
 'htmlOptions' => array('class' => 'imgresult img-polaroid')

),
 array(
'name' => 'title',
 'value' => 'Yii::t("content","$data->title",array(),"db_i18n")'
),
 array(
'name' => 'description',
 'value' => 'Yii::t("content","$data->description",array(),"db_i18n")'
),
 'user_id',
 'category_id',
 array(
                'name' => 'activ',
                'type' => 'raw',
                'value' => '$data->activ=="1" ? CHtml::image("/images/accept.png",Yii::t("content","Ativo")):CHtml::image("/images/cancel.png",Yii::t("content","Desactivado"))',
            ),
 /*
  'date_add',
  'date_expire',
  'img1',
  'img2',
  'img3',
  'img4',
  'img5',
 */
array(
'class' => 'CButtonColumn',
 'template' => '{update}{delete}',
 'buttons' => array(
'delete' => array(
'url' => 'Yii::app()->createUrl("service/delete", array("id"=>$data->id))',
 'imageUrl' => '/images/delete.png'
),
 'update' => array(
'url' => 'Yii::app()->createUrl("service/update", array("id"=>$data->id))',
 'submit' => 'post',
 'imageUrl' => '/images/page_white_edit.png'
 //'options' => array('class'=>'updateFila')
 ),
                ),
            ),
	),
)); ?>
<script>

    $('#service-grid').append('<br><a href="<?php echo Yii::app()->createUrl("service/create") ?>" class="btn btn-success"><?php echo Yii::t("content", 'Adicionar') ?></a>');


</script>